package com.atguigu.adapter.aClasssAdapter;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description:  适配器类
 * @create: 2022-02-13 18:43
 **/
public class VoltageAdapter extends Voltage220V implements IVoltage5V{
    @Override
    public int output5V() {
        //获取220V电压 -1.被适配对象
        int srcV = output220V();
        //转成5V电压（可以添加电器转换的原理） -2.适配后的输出
        int dstV = srcV / 44;
        return dstV;
    }
}
